<%@ page session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<h:panelGroup>
    <fieldset>
    <legend>Dane textu</legend>         
        	<tr:commandLink shortDesc="Zapisz text" action="#{textController.createText}"
                            inlineStyle="background-color:white">
                  <tr:image source="gfx/save_button.png" />
            </tr:commandLink>
    
        <table width="100%" border="0">
            <tr>
                <td><h:outputText value="Rodzaj:"/></td>
                <td>
                    <tr:selectOneListbox id="type" value="#{textBean.type}" size="1" 
                                        valueChangeListener="#{textController.changeTextType}" autoSubmit="true"
                                         contentStyle="width:250px" required="true"
                                         requiredMessageDetail="Typ tekstu jest wymagany" >
                        <f:selectItems value="#{ConstantDictionaries.textType}" />
                    </tr:selectOneListbox>
                
                </td>
            </tr>
            <tr>
                <td>
                <h:outputText value="Kod:"/></td>
                <td>
                    <tr:inputText id="Code" value="#{textBean.code}" contentStyle="width:250px" required="true"
                    				requiredMessageDetail="Kod textu jest wymagany" partialTriggers="type" />
                </td>
            </tr>
            <tr>
                <td>
                <h:outputText value="Treść:"/></td>
                <td>
                    <tr:inputText rows="10" columns="100" id="content" value="#{textBean.content}" shortDesc="Treść" required="true"
                                     contentStyle="text-align:center" />
                </td>
            </tr>
            <tr>
                <td>
                    Komentarz:
                </td>
                <td>
                    <tr:inputText rows="5" columns="100" id="Description" value="#{textBean.description}" shortDesc="Komentarz do tekstu" required="false"/>
                </td>
            </tr>
        </table>
    </fieldset>
</h:panelGroup>